/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package runebound.ui.combate;

import runebound.manejadores.RBControladorJuego;
import runebound.manejadores.eventos.combate.RBEventoDarRecompensa;
import runebound.modelo.heores.Heroe;
import runebound.modelo.monstruos.Monstruo;

/**
 *
 * @author Miguel (alakat@gmail.com)
 */
public class RBFinCombatePanel extends javax.swing.JPanel {
    
    private Monstruo monstruo;
    private Heroe heroe;

    /**
     * Creates new form RBFinCombatePanel
     */
    public RBFinCombatePanel() {
        initComponents();
        this.verdeGema.setVisible(false);
        this.amarilloGema.setVisible(false);
        this.azulGema.setVisible(false);
        this.rojoGema.setVisible(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        textoFinCombate = new javax.swing.JLabel();
        doneButton = new javax.swing.JButton();
        rojoGema = new javax.swing.JLabel();
        verdeGema = new javax.swing.JLabel();
        amarilloGema = new javax.swing.JLabel();
        azulGema = new javax.swing.JLabel();

        setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        textoFinCombate.setText("Fin del combate");
        add(textoFinCombate, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, 250, 88));

        doneButton.setText("Fin del combate");
        doneButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                doneButtonActionPerformed(evt);
            }
        });
        add(doneButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 120, -1, -1));

        rojoGema.setFont(new java.awt.Font("Lucida Grande", 1, 18)); // NOI18N
        rojoGema.setForeground(new java.awt.Color(204, 0, 51));
        rojoGema.setText("+ 4 P. Exp");
        add(rojoGema, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 100, -1, 20));

        verdeGema.setFont(new java.awt.Font("Lucida Grande", 1, 18)); // NOI18N
        verdeGema.setForeground(new java.awt.Color(0, 153, 0));
        verdeGema.setText("+ 1 P. Exp");
        add(verdeGema, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 10, -1, -1));

        amarilloGema.setFont(new java.awt.Font("Lucida Grande", 1, 18)); // NOI18N
        amarilloGema.setForeground(new java.awt.Color(255, 255, 51));
        amarilloGema.setText("+ 2 P. Exp");
        add(amarilloGema, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 40, -1, -1));

        azulGema.setFont(new java.awt.Font("Lucida Grande", 1, 18)); // NOI18N
        azulGema.setForeground(new java.awt.Color(0, 0, 153));
        azulGema.setText("+ 3 P. Exp");
        add(azulGema, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 70, -1, 20));
    }// </editor-fold>//GEN-END:initComponents

    private void doneButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_doneButtonActionPerformed
        
        RBControladorJuego.getInstance().recibirEvento(
                new RBEventoDarRecompensa(this.monstruo.getRecompensa()));
    }//GEN-LAST:event_doneButtonActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel amarilloGema;
    private javax.swing.JLabel azulGema;
    private javax.swing.JButton doneButton;
    private javax.swing.JLabel rojoGema;
    private javax.swing.JLabel textoFinCombate;
    private javax.swing.JLabel verdeGema;
    // End of variables declaration//GEN-END:variables

    public Monstruo getMonstruo() {
        return monstruo;
    }

    public void setMonstruo(Monstruo monstruo) {
        this.monstruo = monstruo;
        
        textoFinCombate.setText(monstruo.getRecompensa().getDescription());
        switch(monstruo.getTipoAmenaza()){
            case AMARILLO:
                this.amarilloGema.setVisible(true);
                break;
            case VERDE:
                this.verdeGema.setVisible(true);
                break;
            case AZUL:
                this.azulGema.setVisible(true);
                break;
            case ROJO:
                this.rojoGema.setVisible(true);
        }
    }

    public Heroe getHeroe() {
        return heroe;
    }

    public void setHeroe(Heroe heroe) {
        this.heroe = heroe;
    }

    
}
